import tensorflow as tf
import util.data_helper as data_helper
import numpy as np
from deeptriage.BiRNN import BiRNN

bug_msg_all, _ = data_helper.get_msg_all()
vocabulary = data_helper.create_vocabulary()
developers_list = data_helper.create_developers_list()

num_classes = len(developers_list)
vocabulary_size = len(vocabulary)
developers_size = len(developers_list)
time_windows = data_helper.split_dataset_by_time_windows(bug_msg_all)


def get_assigner_list(index):
	assigners = []
	for i in range(len(time_windows[index])):
		bug_id = time_windows[index][i]
		assigner = bug_msg_all[bug_id][0]
		assigners.append(assigner)
	return assigners
assigner_0 = get_assigner_list(0)
assigner_1 = get_assigner_list(1)

print('窗口1的bug条数为:{}'.format(len(assigner_1)))

set_0 = set(assigner_0)
unique_0 = [set]
print('窗口0的开发者数量:{}'.format(len(set_0)))
print('窗口1的开发者数量:{}'.format(len(set(assigner_1))))
num = 0
for i in range(len(assigner_1)):
	if assigner_1[i] in set_0:
		num += 1
print(num)
# count_0 = []
# for i in range(len(set_0)):
# 	count_0.append((set_0.pop()))

